<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head>
<title>Student List</title>
<style type="text/css">
  table .odd {
    background-color: lightgrey;
  }
</style>
</head>
<body>
  <h1>Students List</h1>
  <div>
    <a th:href="@{/student/form}">Add a student</a>
  </div>
  <table border="1" width="100%">
    <tr>
      <th>#</th>
      <th>Student No.</th>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Gender</th>
      <th>Operation</th>
    </tr>
    <tr th:each="s,iterStat:${students}" th:class="${iterStat.odd}?'odd'">
      <td th:text="${iterStat.count}">seq</td>
      <td th:text="${s.sno}">sno</td>
      <td th:text="${s.firstname}">firstname</td>
      <td th:text="${s.lastname}">lastname</td>
      <td th:text="${s.gender}">gender</td>
      <td>
        <a th:href="@{/student/view(id=${s.id})}">view</a>
        <a th:href="@{/student/form(id=${s.id})}">edit</a>
        <a th:href="@{/student/delete(id=${s.id})}">delete</a>
      </td>
    </tr>
  </table>
</body>
</html>